package app.r_teenus.backend.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "ADDRESS")
public class Address implements Serializable {

	private static final long serialVersionUID = 7851794269407495684L;

	private Integer id = null;
	private String country = null;
	private String county = null;
	private String townVillage = null;
	private String streetAddress = null;
	private String zipCode = null;
	private AddressType addressType = null;
	private Integer subjectType = null;
	private Integer subject = null;
	private List<AddressType> allAddressType = null;
	private Integer addressTypeId = null;

	/**
	 * Gets id (primary key).
	 */
	@Id
	@Column(name = "ADDRESS")
	@SequenceGenerator(name = "address_id", sequenceName = "address_id", allocationSize = 1)
	@GeneratedValue(generator = "address_id")
	public Integer getId() {
		return id;
	}

	/**
	 * Sets id (primary key).
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * Gets city.
	 */
	@Column(name = "TOWN_VILLAGE")
	public String getTownVillage() {
		return townVillage;
	}

	/**
	 * Sets city.
	 */
	public void setTownVillage(String town) {
		this.townVillage = town;
	}

	public String getCounty() {
		return county;
	}

	public void setCounty(String county) {
		this.county = county;
	}

	/**
	 * Gets state.
	 */
	@Column(name = "STREET_ADDRESS")
	public String getStreetAddress() {
		return streetAddress;
	}

	/**
	 * Sets state.
	 */
	public void setStreetAddress(String state) {
		this.streetAddress = state;
	}

	/**
	 * Gets zip or postal code.
	 */
	@Column(name = "ZIPCODE")
	public String getZipCode() {
		return zipCode;
	}

	/**
	 * Sets zip or postal code.
	 */
	public void setZipCode(String zip) {
		this.zipCode = zip;
	}

	/**
	 * Gets country.
	 */
	public String getCountry() {
		return country;
	}

	/**
	 * Sets country.
	 */
	public void setCountry(String country) {
		this.country = country;
	}

	@OneToOne
	@JoinColumn(name = "ADDRESS_TYPE_FK", nullable = false)
	public AddressType getAddressType() {
		return addressType;
	}

	public void setAddressType(AddressType addressType) {
		this.addressType = addressType;
	}

	@Column(name = "SUBJECT_TYPE_FK")
	public Integer getSubjectType() {
		return subjectType;
	}

	public void setSubjectType(Integer subjectType) {
		this.subjectType = subjectType;
	}

	@Column(name = "SUBJECT_FK")
	public Integer getSubject() {
		return subject;
	}

	public void setSubject(Integer subject) {
		this.subject = subject;
	}

	@Transient
	public List<AddressType> getAllAddressType() {
		return allAddressType;
	}

	public void setAllAddressType(List<AddressType> allAddressType) {
		this.allAddressType = allAddressType;
	}

	@Transient
	public Integer getAddressTypeId() {
		return addressTypeId;
	}

	public void setAddressTypeId(Integer addressTypeId) {
		this.addressTypeId = addressTypeId;
	}

}